//
//  DetailsSuccessViewController.m
//  yonghu
//
//  Created by mac on 2018/5/24.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "DetailsSuccessViewController.h"
#import "DetailsSuccessView.h"

@interface DetailsSuccessViewController ()
@property(nonatomic,strong)DetailsSuccessView *aView;

@end

@implementation DetailsSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"案例详情";
    _aView=[DetailsSuccessView new];
    [self.view addSubview:_aView];
    [_aView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    [self loadDate];
    _aView.viewController=self;
}
-(void)loadDate{
    
    NSDictionary *userDic = [NSKeyedUnarchiver unarchiveObjectWithFile:_userModelFile];
    if (userDic!=nil) {
        NSNumber *waiter_id1=[userDic objectForKey:@"user_id"];
        NSString *user_id=[NSString stringWithFormat:@"%@",waiter_id1];
        
        NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:_classic_id,@"classic_id",@"0",@"user_role",user_id,@"user_id", nil];
        [ZQTools AFNPostDataUrl:@"user/successful/successful_info" Dict:dic andTableView:nil andViewController:self andSuccessBlock:^(id responseObject) {
            _aView.dic=responseObject;
            [_aView creatView];
        } anderrorBlock:nil];
    }
    else{
        
        NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:_classic_id,@"classic_id", nil];
        [ZQTools AFNPostDataUrl:@"user/successful/successful_info" Dict:dic andTableView:nil andViewController:self andSuccessBlock:^(id responseObject) {
            _aView.dic=responseObject;
            [_aView creatView];
        } anderrorBlock:nil];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
